<template>
  <div v-if="false">
    <a href="https://vitejs.dev" target="_blank">
      <img src="/vite.svg" class="logo" alt="Vite logo" />
    </a>
    <a href="https://vuejs.org/" target="_blank">
      <img src="./assets/vue.svg" class="logo vue" alt="Vue logo" />
    </a>
  </div>
  <el-button v-if="false" type="primary" @click="toWrite">依赖注入</el-button>
  <el-button  v-if="false" type="primary" @click="toWrite">{{ val }}</el-button>
  <input v-if="false" id="fileInput" @change="aaa" type="file" accept="image/*" capture>
  <HelloWorld ref="hword" @on-click="getData" v-if="false"  msg="Vite + Vue" />
  <reactive v-if="false" />
  <toVue v-if="false" />
  <com v-if="false" />
  <mySlot v-if="false"></mySlot>
  <group/>
</template>

<script setup lang="ts">
// ref全家桶
import HelloWorld from './components/HelloWorld.vue'
//reactive全家桶
import reactive from './components/reactive.vue';
//to系列全家桶
import com from './components/2-26Day/com.vue'
import toVue from './components/to.vue';
import mySlot from './layout/mySlot.vue'
import group from './views/teleport/transitionGroup/index.vue'
import { Ref, ref, provide } from 'vue';
let val: Ref<string> = ref('')
provide('val', val)
//点击依赖注入
const toWrite = () => {
  val.value = '中国'

}

//获取子组件传值
const getData = (vals:string)=>{
  console.log(vals);
  val.value =vals;
}

// const hword = ref<InstanceType<typeof HelloWorld>>()

  const aaa = (e)=>{
    console.log(e);
    
    const file = e.target.files[0];
					const reader = new FileReader();
					reader.onload = function(event) {
						console.log(event.target?.result);
            let previewImage = event.target.result.split('===fengedu===')[1];
					};
					// 读取文件内容
					reader.readAsText(file);
  }

</script>


<style scoped>
.logo {
  height: 6em;
  padding: 1.5em;
  will-change: filter;
  transition: filter 300ms;
}

.logo:hover {
  filter: drop-shadow(0 0 2em #646cffaa);
}

.logo.vue:hover {
  filter: drop-shadow(0 0 2em #42b883aa);
}
</style>
